<?php
session_start();
ini_set('display_errors',1);
require($_SERVER['DOCUMENT_ROOT'].'/resources/lib/database.php');
require($_SERVER['DOCUMENT_ROOT'].'/resources/lib/functions.php');
require($_SERVER['DOCUMENT_ROOT'].'/resources/lib/class.admin.php');
$admin=new admin(); // worry about the URL another time - changes to title effect the URL.
$admin->canView($_SERVER['PHP_SELF']);

$admin->pageId($_POST['blog_page_id']);
$content=$admin->clean($_POST['blog_post_content']);
$item=array('$set'=>array(	'content'=>$content,
				'heading'=>$_POST['blog_post_title'],
				'tags'=>$admin->explode_trim($_POST['blog_post_tags']),
				'active'=>intval($_POST['blog_post_active']),
				'meta'=>array(
					'keywords'=>$_POST['blog_post_keywords'],
					'title'=>$_POST['blog_post_title'],
					'description'=>$_POST['blog_post_description']
				),
				'is_blog'=>intval(1),
				'is_blog_post'=>intval(1),
				'url'=>$_POST['blog_post_url']
			
			));
$admin->updateBlogPost($item);



?>